package com.kun.portal.webframe.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by Administrator on 2018-09-09.
 * 消息推送
 */
@Entity
@Table(
        name = "message_push"
)
public class MessagePushPo implements Serializable{
    @Id
    @GeneratedValue(
            generator = "mg_id"
    )

    @GenericGenerator(
            name = "mg_id",
            strategy = "uuid"
    )
    @Column(
            name = "mg_id",
            length = 32,
            nullable = false
    )
    private String mgId;//id
    @Column(
            name = "mg_name",
            length = 32
    )
    private String mgName;//消息名称
    @Column(
            name = "mg_type",
            length = 32
    )
    private String mgType;//消息类型

    @Column(
            name = "module_type",
            length = 32
    )
    private String moduleType;//消息类型

    @ManyToOne(targetEntity = FwUserPo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "handel_user_id", referencedColumnName = "user_id")
    private FwUserPo handelUser;//处理人


    @ManyToOne(targetEntity = FwUserPo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "push_user_id", referencedColumnName = "user_id")
    private FwUserPo pushUser;//推送人


    @Column(
            name = "push_time",
            length = 32
    )
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="Asia/Shanghai")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pushTime;//推送时间
    @Column(
            name = "see",
            length = 32
    )
    private Boolean see;//是否查看

    public Boolean getHandle() {
        return handle;
    }

    public void setHandle(Boolean handle) {
        this.handle = handle;
    }

    @Column(
            name = "handle",
            length = 32
    )

    private Boolean handle=false;//是否处理
    @Column(
            name = "handle_time",
            length = 32

    )
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    @Temporal(TemporalType.TIMESTAMP)
    private Date handleTime;//处理时间
    @Column(
            name= "mg_content",
            length = 500
    )
    private String mgContent;//消息内容

    public String getMgId() {
        return mgId;
    }

    public void setMgId(String mgId) {
        this.mgId = mgId;
    }

    public String getMgName() {
        return mgName;
    }

    public void setMgName(String mgName) {
        this.mgName = mgName;
    }

    public String getMgType() {
        return mgType;
    }

    public void setMgType(String mgType) {
        this.mgType = mgType;
    }

    public FwUserPo getHandelUser() {
        return handelUser;
    }

    public void setHandelUser(FwUserPo handelUser) {
        this.handelUser = handelUser;
    }

    public FwUserPo getPushUser() {
        return pushUser;
    }

    public void setPushUser(FwUserPo pushUser) {
        this.pushUser = pushUser;
    }

    public Date getPushTime() {
        return pushTime;
    }

    public void setPushTime(Date pushTime) {
        this.pushTime = pushTime;
    }

    public Boolean getSee() {
        return see;
    }

    public void setSee(Boolean see) {
        this.see = see;
    }

    public Date getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }

    public String getMgContent() {
        return mgContent;
    }

    public void setMgContent(String mgContent) {
        this.mgContent = mgContent;
    }


    public String getModuleType() {
        return moduleType;
    }

    public void setModuleType(String moduleType) {
        this.moduleType = moduleType;
    }
}
